package fangzhiyi.test;

/**
 * @author fangzhiyi
 * @version 1.0
 * @date 2025/3/18 18:31
 * @description
 */
class Vehicle {
    private int speed;
    private int size;

    public void move() {
        System.out.println("交通工具正在移动。");
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public void speedUp() {
        this.speed++;
    }

    public void speedDown() {
        if (this.speed > 0) {
            this.speed--;
        }
    }

    public int getSpeed() {
        return speed;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }
}